package main

import (
	"bufio"
	"fmt"
	_ "go/scanner"
	"io"
	"os"
	"strconv"
	"strings"
)

var (
	firstName, lastName string
)

func main() {
	//Enter your code here. Read input from STDIN. Print output to STDOUT
	reader := bufio.NewReader(os.Stdin)
	lineTemp, err := strconv.ParseInt(readLine(reader), 10, 64)
	checkErr(err)
	line := int(lineTemp)
	for i := 0; i < line; i++ {
		var input string
		_, _ = fmt.Scan(&input)
		var f string
		var s string
		for x := 0; x < len(input); x++ {
			if x%2 == 0 {
				f +=  string(input[x])
			//	fmt.Print("%s------",f)
			} else {
				s += string(input[x])
			}
		}
		fmt.Println(f + " " + s)

	}

}
func readLine(reader *bufio.Reader) string {
	str, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}

	return strings.TrimRight(string(str), "\r\n")
}
func checkErr(err error) {
	if err != nil {

		fmt.Println("read error:", err)
	}
}
